'use strict';
//班级管理
const Controller = require('egg').Controller;

class StudentController extends Controller {
    //查看所有项目
    async getstudent() {
        const data = await this.ctx.service.student.getstudent();
        this.ctx.body = data;
    }
    //查看项目下的班级
    async outclass() {
        const project = this.ctx.query.project;
        const data = await this.ctx.service.student.outclass(project);
        this.ctx.body = data;
    }
    //查看所属项目班级的详细信息
    async posttudent() {
        const student = this.ctx.request.body;
        const data = await this.ctx.service.student.posttudent(student);
        this.ctx.body = data;
    }
    //添加学生
    async createstudent() {
        const student = this.ctx.request.body;
        const data = await this.ctx.service.student.createstudent(student);
        this.ctx.body = data;
    }
}

module.exports = StudentController;
